home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 July & August
/
rerun-1986-07-08.d64
/
mag production
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
154 lines
0 goto 100
1 rem mag prod v1.2
2 rem (c) 1986 david a. hook
9 rem position at rec #r
10 print#15,"p"+chr$(3)+chr$(rand255)+chr$(r/256)+chr$(1):return
19 rem disk error check
20 input#15,de,de$,t,s: if de<20 or de=50 or de=51 then return
25 print " [196]isk [197]rror[146]";de;de$;t;s
30 close 3: close 2: close 15: end
49 rem exit subroutine
50 close 3: close 2: close 15
55 print " [208]ress [211][208][193][195][197] [212]o [197]xit"
60 get z$: if z$<>chr$(32) goto 60
65 return
100 a$="abcdefghijklmnopqrst": a$=a$+a$+"u"
120 rem issue name, drive#, max pages
130 read f3$, d3$, mp
150 lp=25: ad=896: ck=0: if peek(ad)=160 goto 190
160 for i=ad to ad+41: read da: poke i,da: ck=ck+da: next
180 if ck<>6121 then print "error in data": stop
190 :
200 print "[147]"; tab(11); "[211][207][198][212][215][193][210][197] [205][193][199][193][218][201][206][197]"; spc(21); "(c)1986 [196]avid [193]. [200]ook"
210 print " 1. [195]reate [206]ew [201]ssue": print " 2. [193]dd [212]o [193]n [201]ssue"
220 print " 3. [212]able [207]f [195]ontents": print " 4. [196]elete [212]ext [198]iles"
230 print " 5. [198]ix [208]age [195]ounter": print " 6. [209]uit [208]rogram"
250 print " [195]hoice (1-5): ?[157]";
260 get z$: if z$<"1" or z$>"6" goto 260
270 print ""; z$
280 for i=1 to 1500: next
300 on val(z$) gosub 1000, 2000, 3000, 4000, 5000, 30
310 goto 200
499 rem issue sbr
500 print" [208]lace the [201]ssue [196]isk in the drive"
510 print ""; tab(15); f3$
520 input "[145] [201]ssue [206]ame: "; f3$
530 print tab(15); d3$
540 input "[145] [207]n [196]rive #: "; d3$
560 open 15, 8, 15, "i"+d3$: gosub 20
580 f$ = d3$ + ":" + f3$: if z$="1" then f$= f3$ + ",l,"+ chr$(40)
590 open 3, 8, 3, f$: gosub 20
610 return
999 rem create new issue
1000 print "[147]"; tab(12); "[195]reate [206]ew [201]ssue"
1010 print" [208]lace a [198]ormatted [196]isk in the drive"
1020 gosub 510
1040 print ""; tab(14); mp
1050 input "[145] [205]ax [208]age #: "; mp
1070 print " [208]lease wait a few moments..."
1090 rem create last record
1100 ln=lp*mp+1
1110 r=ln: gosub 10
1120 print#3, chr$(255)
1130 r=ln: gosub 10
1150 rem point to issue page 2
1160 r=1: gosub 10
1170 print#3, lp+1
1180 r=1: gosub 10
1200 gosub 20
1220 print " [196]one."
1240 goto 50
1999 rem add to an issue
2000 print "[147]"; tab(12); "[193]dd [212]o [193]n [201]ssue"
2010 gosub 500
2030 input " [212]ext [198]ile: *[157][157][157]"; f2$
2040 if f2$="*" goto 2030
2050 input " [207]n [196]rive #: 0[157][157][157]"; d2$
2060 if d2$<>"0" and d2$<>"1" goto 2050
2080 if d2$<>d3$ then print#15, "i"+d2$: gosub 20
2100 open 2, 8, 2, d2$+":"+f2$: gosub 20
2120 print " [215]orking..."
2140 rem fetch line count
2150 r=1: gosub 10
2160 input#3, n: fl=n
2170 r=1: gosub 10
2190 rem bump count
2200 n=n+1
2220 rem get text line
2230 sys ad: ss=st
2240 l=peek(142)
2260 rem write it to issue
2270 r=n: gosub 10
2280 print#3, left$(a$,l)
2290 r=n: gosub 10
2310 gosub 20
2330 rem check end of file
2340 if ss=0 goto 2200
2360 rem update line count
2370 r=1: gosub 10
2380 print#3, n: ll=n
2390 r=1: gosub 10
2410 print " [211]tart: [208]age"; (fl-1)/lp+1
2420 print " [197]nd: [208]age"; (ll-1)/lp
2440 goto 50
2999 rem table of contents
3000 print "[147]"; tab(11); "[212]able [207]f [195]ontents"
3010 gosub 500
3030 input " [195]ontents: *[157][157][157]"; f2$
3040 if f2$="*" goto 3030
3050 input " [207]n [196]rive #: 0[157][157][157]"; d2$
3060 if d2$<>"0" and d2$<>"1" goto 3050
3080 if d2$<>d3$ then print#15, "i"+d2$: gosub 20
3100 open 2, 8, 2, d2$+":"+f2$: gosub 20
3120 rem set to first line
3130 n=1
3150 rem bump count
3160 n=n+1
3180 rem get text line
3190 sys ad: ss=st
3200 l=peek(142)
3220 rem write it to issue
3230 r=n: gosub 10
3240 print#3, left$(a$,l)
3250 r=n: gosub 10
3270 gosub 20
3290 rem check end of file
3300 if ss=0 goto 3160
3320 goto 50
3999 rem delete text files
4000 print "[147]"; tab(11); "[196]elete [212]ext [198]iles"
4010 print " [208]lace the [212]ext [198]ile [196]isk in drive #0"
4020 input " [212]ext [198]ile prefix: p/[157][157][157][157]"; pr$
4030 if pr$="*" goto 4020
4050 print " [211]cratch [198]iles prefixed with: "; chr$(34); pr$; chr$(34)
4060 input " [201]s this [207][203] (y/n): n[157][157][157]"; z$
4070 if z$<>"y" then return
4090 print " [215]orking..."
4110 open 15, 8, 15, "i"+d3$: gosub 20
4130 print#15, "s0:"+pr$+"*": gosub 20
4140 print " "; de$;t
4160 goto 50
4999 rem fix page counter
5000 print "[147]"; tab(12); "[198]ix [208]age [195]ounter"
5010 gosub 500
5030 rem fetch line count
5040 r=1: gosub 10
5050 input#3, n
5060 r=1: gosub 10
5080 rem offer change
5090 print ""; tab(22); (n-1)/lp
5100 input "[145] [195]hange [197]nd [208]age to: "; n
5120 rem update line count
5130 r=1: gosub10
5140 print#3, n*lp+1
5150 r=1: gosub10
5170 goto 50
7000 rem issue name, drive #
7010 data "jul86", 0
7100 rem max # of pages
7110 data 60
8000 rem c64 string thing data (file 2)
8010 data 160,2,177,45,153,137,0,200,192,6,208,246,162,2
8020 data 32,198,255,32,228,255,201,13,240,15,164,142,145,140
8030 data 200,132,142,196,139,240,4,165,144,240,234,76,204,255